home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
qb2
/
pro16
/
bclose.bas
next >
Wrap
BASIC Source File
|
1992-02-06
|
4KB
|
100 lines
' BClose.Bas
' Portions Copyright 1987-1990 Microsoft Corp.
DEFINT A-Z
SUB ButtonClose (handle)
' =======================================================================
' Make sure a window is actually opened
' =======================================================================
windo = WindowCurrent
IF windo > 0 THEN
' ===================================================================
' If handle=0, recursively close all buttons in the CURRENT WINDOW only
' ===================================================================
IF handle = 0 THEN
IF GloStorage.numButtonsOpen > 0 THEN
FOR A = GloStorage.numButtonsOpen TO 1 STEP -1
IF GloButton(A).windowHandle = windo THEN
ButtonClose GloButton(A).handle
END IF
NEXT A
END IF
ELSE
' ===============================================================
' Get the index into the global array based on handle, and
' currWindow
' ===============================================================
button = FindButton(handle)
' ===============================================================
' If valid, hide button, then squeeze array, decrement totals
' ===============================================================
IF button > 0 THEN
COLOR GloWindow(windo).fore, GloWindow(windo).back
SELECT CASE GloButton(button).buttonType
CASE 1, 2, 3
LOCATE GloWindow(windo).row1 + GloButton(button).row1 - 1, _
GloWindow(windo).col1 + GloButton(button).col1 - 1
MouseHide
PRINT SPACE$(4 + LEN(RTRIM$(GloButton(button).text$)));
MouseShow
CASE 5
MouseHide
FOR aRow = GloWindow(windo).row1 _
+ GloButton(button).row1 - 1 _
TO GloWindow(windo).row1 _
+ GloButton(button).row1 + 1
LOCATE aRow, _
GloWindow(windo).col1 + GloButton(button).col1 - 1
PRINT SPACE$(4 + LEN(RTRIM$(GloButton(button).text$)));
NEXT aRow
MouseShow
CASE 6
MouseHide
FOR A = 1 TO _
GloButton(button).row2 - GloButton(button).row1 + 1
LOCATE _
GloWindow(windo).row1 + GloButton(button).row1 + A - 2, _
GloWindow(windo).col1 + GloButton(button).col1 - 1
PRINT " ";
NEXT A
MouseShow
CASE 7
LOCATE GloWindow(windo).row1 + GloButton(button).row1 - 1, _
GloWindow(windo).col1 + GloButton(button).col1 - 1
MouseHide
PRINT _
SPACE$(GloButton(button).col2 - GloButton(button).col1 + 1);
MouseShow
CASE ELSE
END SELECT
GloStorage.numButtonsOpen = GloStorage.numButtonsOpen - 1
WHILE button <= GloStorage.numButtonsOpen
GloButton(button).row1 = GloButton(button + 1).row1
GloButton(button).col1 = GloButton(button + 1).col1
GloButton(button).row2 = GloButton(button + 1).row2
GloButton(button).col2 = GloButton(button + 1).col2
GloButton(button).text = GloButton(button + 1).text
GloButton(button).handle = GloButton(button + 1).handle
GloButton(button).state = GloButton(button + 1).state
GloButton(button).buttonType = GloButton(button + 1).buttonType
GloButton(button).windowHandle = _
GloButton(button + 1).windowHandle
button = button + 1
WEND
END IF
END IF
END IF
END SUB